<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								id：<input type="text" name="id"/>
							</li>

<!--							<li>-->
<!--								名字：<input type="text" name="name"/>-->
<!--							</li>-->

							<li>
								身份证：<input type="text" name="idNum"/>
							</li>

							<li>
								状态： <select  name="state">
									<option value="-1">全部</option>
									<option value="0">未审核</option>
									<option value="1">已审核</option>
									<option value="2">审核失败（不符合)</option>
								</select>
							</li>

							<li>
								操作员id：<input type="text" name="staName"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<!--				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="core:prUser:add">-->
<!--					<i class="fa fa-plus"></i> 添加-->
<!--				</a>-->
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="core:prUser:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
<!--				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="core:prUser:remove">-->
<!--					<i class="fa fa-remove"></i> 删除-->
<!--				</a>-->
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="core:prUser:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('core:prUser:edit')}]];
        var removeFlag = [[${@permission.hasPermi('core:prUser:remove')}]];
        var prefix = ctx + "core/prUser";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "登查人员",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : 'id',
					visible: true
				},
				// {
				// 	field : 'num',
				// 	title : '不使用',
				// 	sortable: true
				// },
				{
					field : 'country', 
					title : '镇',
					sortable: true
				},
				{
					field : 'village', 
					title : '村',
					sortable: true
				},
				{
					field : 'name', 
					title : '名字',
					sortable: true
				},
				{
					field : 'idNum', 
					title : '身份证',
					sortable: true
				},
				{
					field : 'phone', 
					title : '手机号',
					sortable: true
				},
				{
					field : 'state', 
					title : '状态',
					formatter: function(value, item, index) {
						if (item.state == 0) {
							return '<span class="label label-success">未审核</span>';
						}
						else if (item.state == 1) {
							return '<span class="label label-primary">已审核</span>';
						}
						else if (item.state == 2) {
							return '<span class="label label-warning">审核失败（不符合）</span>';
						}

					}
				},
				{
					field : 'message',
					title : '不符合原因',
					sortable: true
				},
				{
					field : 'staName', 
					title : '操作员',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
						actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>图片列表</a> ');
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });


		/*字典列表-详细*/
		function detail(id) {
			var url = prefix + '/detail/' + id;
			createMenuItem(url, "用户图片");
		}
    </script>
</body>
</html>